﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Default.Master"
  AutoEventWireup="true" CodeBehind="UserFunctions.aspx.cs" Inherits="HPS.TTCS.Web.Pages.UserFunctions" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <link rel="stylesheet" type="text/css" href="../Styles/style.css" media="screen" />
  <div id="divContent" runat="server">
    <table width="100%">
      <tr>
        <td class="search_header">
          Phân quyền người dùng
        </td>
      </tr>
      <tr>
        <td class="insert_header">
          <asp:Literal ID="Literal5" runat="server" Text="Danh sách người dùng"></asp:Literal>
        </td>
      </tr>
      <tr>
        <td class="formInfo">
          <table width="100%">
            <tr>
              <td style="width: 10%" />
              <td>
                <dxwgv:ASPxGridView ID="gvUserList" ClientInstanceName="gvUserList" KeyFieldName="Id"
                  runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua"
                  Width="100%" EnableCallbackCompression="True" AutoGenerateColumns="False" OnCustomCallback="gvUserList_CustomCallback"
                  OnCustomJSProperties="gvUserList_CustomJSProperties" OnPageIndexChanged="gvUserList_PageIndexChanged">
                  <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
                  </Styles>
                  <SettingsBehavior AllowDragDrop="False" AllowGroup="False" AllowSort="False" />
                  <SettingsPager PageSize="20">
                    <AllButton>
                      <Image Height="19px" Width="27px" />
                    </AllButton>
                    <FirstPageButton>
                      <Image Height="19px" Width="23px" />
                    </FirstPageButton>
                    <LastPageButton>
                      <Image Height="19px" Width="23px" />
                    </LastPageButton>
                    <NextPageButton>
                      <Image Height="19px" Width="19px" />
                    </NextPageButton>
                    <PrevPageButton>
                      <Image Height="19px" Width="19px" />
                    </PrevPageButton>
                  </SettingsPager>
                  <Images ImageFolder="~/App_Themes/Aqua/{0}/">
                    <HeaderSortDown Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png"
                      Width="7px" />
                    <ExpandedButton Height="15px" Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png"
                      Width="15px" />
                    <CollapsedButton Height="15px" Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png"
                      Width="15px" />
                    <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" Width="19px" />
                    <DetailCollapsedButton Height="15px" Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png"
                      Width="15px" />
                    <DetailExpandedButton Height="15px" Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png"
                      Width="15px" />
                    <HeaderActiveFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png"
                      Width="19px" />
                    <HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" Width="7px" />
                    <FilterRowButton Height="13px" Width="13px" />
                    <WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" Width="13px" />
                  </Images>
                  <SettingsLoadingPanel Text="" Mode="Disabled" />
                  <StylesEditors>
                    <ProgressBar Height="25px">
                    </ProgressBar>
                  </StylesEditors>
                  <ImagesEditors>
                    <CalendarFastNavPrevYear Height="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png"
                      Width="19px" />
                    <SpinEditLargeIncrement Height="9px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png"
                      UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" Width="7px" />
                    <SpinEditLargeDecrement Height="9px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png"
                      UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" Width="7px" />
                    <SpinEditIncrement Height="6px" Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png"
                      UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png"
                      Width="7px" />
                    <SpinEditDecrement Height="7px" Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png"
                      UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png"
                      Width="7px" />
                    <CalendarFastNavNextYear Height="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png"
                      Width="19px" />
                    <DropDownEditDropDown Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png"
                      Width="9px" />
                  </ImagesEditors>
                  <Columns>
                    <dxwgv:GridViewDataTextColumn CellStyle-HorizontalAlign="Center" VisibleIndex="1"
                      Width="10%">
                      <DataItemTemplate>
                        <img alt="" src="../Images/edit.png" onclick="fillValue('<%#Eval("Username")%>','<%#Eval("FullName")%>','<%#Eval("Address")%>','<%#Eval("Phone")%>','<%#Eval("Email")%>','<%#Eval("Status")%>')"
                          style="cursor: pointer" />
                        <%--<img alt="" src="../Images/delete.png" onclick="deleteInfo('<%#Eval("Username")%>')" style="cursor: pointer" />--%>
                      </DataItemTemplate>
                      <CellStyle HorizontalAlign="Center">
                      </CellStyle>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="Tên đăng nhập"
                      FieldName="Username" VisibleIndex="2">
                      <HeaderStyle HorizontalAlign="Center" />
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataComboBoxColumn Caption="Trạng thái"
                      FieldName="Status" VisibleIndex="3">
                      <HeaderStyle HorizontalAlign="Center" />
                      <PropertiesComboBox DataSourceID="xdsStatus" ValueField="Id" TextField="Name" ValueType="System.String" />
                    </dxwgv:GridViewDataComboBoxColumn>
                  </Columns>
                  <ClientSideEvents EndCallback="function(s,e){
                      OnGvUserListEndCallback(s,e);
                      }" />
                </dxwgv:ASPxGridView>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td class="insert_header">
          <asp:Literal ID="Literal3" runat="server" Text="Thông tin chung"></asp:Literal>
        </td>
      </tr>
      <tr>
        <td class="formInfo">
          <table border="0" width="100%">
            <tr>
              <td style="width: 20%">
                <asp:Literal ID="Literal1" runat="server" Text="Tên đăng nhập"></asp:Literal>
                :
              </td>
              <td style="width: 25%">
                <dxe:ASPxTextBox ID="txtUsername" ClientInstanceName="txtUsername" runat="server"
                  CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
              <td style="width: 20%; padding-left: 15px;">
                <asp:Literal ID="Literal6" runat="server" Text="Họ và tên"></asp:Literal>
                :
              </td>
              <td>
                <dxe:ASPxTextBox ID="txtFullname" ClientInstanceName="txtFullname" runat="server"
                  CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
            </tr>
            <tr>
              <td style="width: 20%">
                <asp:Literal ID="Literal2" runat="server" Text="Số điện thoại"></asp:Literal>
                :
              </td>
              <td style="width: 25%">
                <dxe:ASPxTextBox ID="txtPhone" runat="server" ClientInstanceName="txtPhone" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                  CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
              <td style="width: 20%; padding-left: 15px;">
                <asp:Literal ID="Literal7" runat="server" Text="Địa chỉ"></asp:Literal>
                :
              </td>
              <td>
                <dxe:ASPxTextBox ID="txtAddress" ClientInstanceName="txtAddress" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                  CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
            </tr>
            <tr>
              <td style="width: 20%">
                <asp:Literal ID="Literal8" runat="server" Text="Trạng thái"></asp:Literal>
                :
              </td>
              <td style="width: 25%">
                <dxe:ASPxComboBox ID="cbxStatus" ClientInstanceName="cbxStatus" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                  CssPostfix="Aqua" ImageFolder="~/App_Themes/Aqua/{0}/" LoadingPanelText="" ShowShadow="False"
                  TextField="Name" ValueField="Id" ValueType="System.String" Width="100%" DataSourceID="xdsStatus">
                  <ButtonEditEllipsisImage Height="3px" Url="~/App_Themes/Aqua/Editors/edtEllipsis.png"
                    UrlDisabled="~/App_Themes/Aqua/Editors/edtEllipsisDisabled.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtEllipsisHottracked.png"
                    UrlPressed="~/App_Themes/Aqua/Editors/edtEllipsisPressed.png" Width="12px" />
                  <DropDownButton>
                    <Image Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png" UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png"
                      UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" UrlPressed="~/App_Themes/Aqua/Editors/edtDropDownPressed.png"
                      Width="9px" />
                  </DropDownButton>
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" Width="14px" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxComboBox>
              </td>
              <td style="width: 20%; padding-left: 15px;">
                <asp:Literal ID="Literal9" runat="server" Text="Email"></asp:Literal>
                :
              </td>
              <td>
                <dxe:ASPxTextBox ID="txtEmail" ClientInstanceName="txtEmail" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                  CssPostfix="Aqua" Width="100%">
                  <ValidationSettings>
                    <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" />
                    <ErrorFrameStyle ImageSpacing="4px">
                      <ErrorTextPaddings PaddingLeft="4px" />
                    </ErrorFrameStyle>
                  </ValidationSettings>
                </dxe:ASPxTextBox>
              </td>
            </tr>
            <tr>
              <td colspan="4" align="center" style="width: 100%; padding-top: 10px; padding-bottom: 20px">
                <table>
                  <tr>
                    <td>
                      <dxe:ASPxButton ID="btnReset" runat="server" Text="Khôi phục mật khẩu"
                        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" AutoPostBack="False">
                        <Image Url="../Images/update.png" />
                        <ClientSideEvents Click="function(s, e) {
                                    onBtnResetPass(s, e);
                                }" />
                      </dxe:ASPxButton>
                    </td>
                    <td>
                      <dxe:ASPxButton ID="btnNewBook" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
                        CssPostfix="Aqua" AutoPostBack="False" Text="Tạo mới">
                        <Image Url="../Images/add.png" />
                        <ClientSideEvents Click="function(s, e) {
                                    onBtnNewClick(s, e);
                                }" />
                      </dxe:ASPxButton>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td class="insert_header">
          <asp:Literal ID="Literal4" runat="server" Text="Danh sách quyền người dùng"></asp:Literal>
        </td>
      </tr>
      <tr>
        <td class="formInfo">
          <table width="100%">
            <tr>
              <td style="width: 10%" />
              <td>
                <dxwgv:ASPxGridView ID="gvFunctions" ClientInstanceName="gvFunctions" KeyFieldName="Id"
                  runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua"
                  Width="100%" EnableCallbackCompression="True" AutoGenerateColumns="False" OnCustomCallback="gvFunctions_CustomCallback">
                  <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
                  </Styles>
                  <SettingsBehavior AllowDragDrop="False" AllowGroup="False" AllowSort="False" />
                  <SettingsPager PageSize="30">
                    <AllButton>
                      <Image Height="19px" Width="27px" />
                    </AllButton>
                    <FirstPageButton>
                      <Image Height="19px" Width="23px" />
                    </FirstPageButton>
                    <LastPageButton>
                      <Image Height="19px" Width="23px" />
                    </LastPageButton>
                    <NextPageButton>
                      <Image Height="19px" Width="19px" />
                    </NextPageButton>
                    <PrevPageButton>
                      <Image Height="19px" Width="19px" />
                    </PrevPageButton>
                  </SettingsPager>
                  <Images ImageFolder="~/App_Themes/Aqua/{0}/">
                    <HeaderSortDown Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png"
                      Width="7px" />
                    <ExpandedButton Height="15px" Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png"
                      Width="15px" />
                    <CollapsedButton Height="15px" Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png"
                      Width="15px" />
                    <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" Width="19px" />
                    <DetailCollapsedButton Height="15px" Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png"
                      Width="15px" />
                    <DetailExpandedButton Height="15px" Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png"
                      Width="15px" />
                    <HeaderActiveFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png"
                      Width="19px" />
                    <HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" Width="7px" />
                    <FilterRowButton Height="13px" Width="13px" />
                    <WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" Width="13px" />
                  </Images>
                  <SettingsLoadingPanel Text="" Mode="Disabled" />
                  <StylesEditors>
                    <ProgressBar Height="25px">
                    </ProgressBar>
                  </StylesEditors>
                  <ImagesEditors>
                    <CalendarFastNavPrevYear Height="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png"
                      Width="19px" />
                    <SpinEditLargeIncrement Height="9px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png"
                      UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" Width="7px" />
                    <SpinEditLargeDecrement Height="9px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png"
                      UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" Width="7px" />
                    <SpinEditIncrement Height="6px" Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png"
                      UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png"
                      Width="7px" />
                    <SpinEditDecrement Height="7px" Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png"
                      UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png"
                      Width="7px" />
                    <CalendarFastNavNextYear Height="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png"
                      Width="19px" />
                    <DropDownEditDropDown Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png"
                      UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png"
                      Width="9px" />
                  </ImagesEditors>
                  <Columns>
                    <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" Width="7%" VisibleIndex="0">
                      <HeaderStyle HorizontalAlign="Center">
                        <Paddings PaddingBottom="1px" PaddingTop="1px" />
                      </HeaderStyle>
                      <HeaderTemplate>
                        <input id="chkSelAll" onclick="gvFunctions.SelectAllRowsOnPage(this.checked);" style="vertical-align: middle;"
                          type="checkbox" runat="server" />
                      </HeaderTemplate>
                    </dxwgv:GridViewCommandColumn>
                    <dxwgv:GridViewDataTextColumn Caption="Tên quyền"
                      FieldName="Name" VisibleIndex="2">
                      <HeaderStyle HorizontalAlign="Center" />
                    </dxwgv:GridViewDataTextColumn>
                  </Columns>
                  <ClientSideEvents EndCallback="function(s,e){
                        OnGvFunctionsEndCallback(s,e);
                        }" />
                </dxwgv:ASPxGridView>
              </td>
            </tr>
            <tr>
              <td colspan="2" align="center" style="width: 100%; padding-top: 10px; padding-bottom: 20px">
                <table>
                  <tr>
                    <td align="left">
                      <dxe:ASPxButton ID="btnSave" runat="server" Text="Lưu"
                        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" AutoPostBack="False">
                        <Image Url="../Images/save.png" />
                        <ClientSideEvents Click="function(s, e) {
                                    onBtnSaveClick(s, e);
                                }" />
                      </dxe:ASPxButton>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <asp:HiddenField ID="hfUser" runat="server" />
    <asp:XmlDataSource ID="xdsStatus" runat="server" XPath="Status/UserStatus/Item"
      DataFile="~/App_Data/Status.vi-VN.xml"></asp:XmlDataSource>
  </div>

  <script language="javascript" type="text/javascript">

    function onBtnSaveClick(s, e) {
      pcWaiting.Show();
      gvUserList.PerformCallback('Save');
    }

    function onBtnResetPass(s, e) {
      pcWaiting.Show();
      gvUserList.PerformCallback('ResetPass');
    }

    function onBtnNewClick(s, e) {
      fillValue('', '', '', '', '', '');
    }

    function fillValue(username, fullname, address, phone, email, status) {
      document.getElementById('<%=hfUser.ClientID %>').value = username;
      txtUsername.SetText(username);
      txtFullname.SetText(fullname);
      txtAddress.SetText(address);
      txtPhone.SetText(phone);
      txtEmail.SetText(email);
      if (status != '') {
        cbxStatus.SetValue(status);
      }
      else {
        cbxStatus.SetValue('A');
      }
      if (username != '') {  
        pcWaiting.Show();
        txtUsername.SetEnabled(false);
        gvFunctions.PerformCallback(username);
      } else {
        txtUsername.SetEnabled(true);
        gvFunctions.SelectAllRowsOnPage(false);
      }
    }

    function OnGvFunctionsEndCallback(s, e) {
      pcWaiting.Hide();
    }

    function OnGvUserListEndCallback(s, e) {
      pcWaiting.Hide();
      var error = gvUserList.cpInnerError;
      var errors = error.split("|");
      if (errors[0] != 'S') {
        alert(error);
      }
      else {
        if (errors[1] == 'Save') {
          alert(errors[2]);
          fillValue('', '', '', '', '', '');
       }
      }
    }
  </script>

</asp:Content>
